home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_ent2mmfog.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  90 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_Ent2MMFog.cog
  4. #
  5. # [MDR] && [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     entered
  14.     message     pulse
  15.     
  16.     thing       player          local
  17.     thing       fogGhost
  18.     
  19.     sector      connect
  20.     sector      mazeRoom
  21.                        
  22.     vector      vec_facing      local
  23.     
  24.     int         inConnect=0        local
  25.     
  26. end
  27.  
  28. # ========================================================================================
  29.  
  30. code
  31.  
  32. startup:
  33.  
  34.     player = GetLocalPlayerThing();
  35.     return;
  36.     
  37. # ========================================================================================
  38.  
  39. entered:
  40.  
  41.     if(GetSenderRef() == connect)
  42.     {
  43.         Print("entered connect");
  44.         inConnect = 1;
  45.         SetPulse(0.5);
  46.     }
  47.     
  48.     if(GetSenderRef() == mazeRoom)
  49.     {
  50.         Print("entered mazeRoom");
  51.         inConnect = 0;
  52.         SetPulse(0.0);
  53.     }
  54.         
  55.     return;
  56.         
  57. # ========================================================================================
  58.  
  59. pulse:
  60.  
  61.     vec_facing = VectorSub( GetThingPos(fogGhost), GetThingPos(player));
  62.     vec_facing = VectorNorm(vec_facing);
  63.     
  64.     if(inConnect == 1)
  65.     {
  66.         if (VectorDot(GetThingLVec(player), vec_facing) >= 0)
  67.         {
  68.             # Player is facing fogGhost
  69.             # set distances for entrance room
  70.             SetFog(1, '0.5, 0.05 0.05', 20, 80);
  71.         }
  72.         
  73.         else
  74.         {
  75.             # player's back is to fogGhost
  76.             # set distances for melt maze
  77.             SetFog(1, '0.5, 0.05 0.05', 50, 150);
  78.         }
  79.     }
  80.     
  81.     else
  82.         return;
  83.     
  84.     return;
  85.         
  86. # ========================================================================================
  87.  
  88. end
  89.  
  90.